<template>
  <div v-if="question">
    <el-form label-width="60px" size="mini">
      <el-form-item label="问题：">
        <el-input v-model="question.topic"></el-input>
      </el-form-item>
      <el-form-item label="提示：">
        <el-input v-model="question.activeText">
          <template slot="prepend">激活文本</template>
        </el-input>
        <el-input v-model="question.inactiveText">
          <template slot="prepend">禁用文本</template>
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  export default {
    name: "edit-i-switch",
    props: ['page','question'],
    created(){
      if(!this.question.style)
        this.question.style='datetime'
    },
    methods:{
      onSubmit(){
        this.$emit('edit',this.question)
      }
    }
  }
</script>

<style scoped>

</style>
